<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var a = new Array(10);
        for (var i = 0; i < a.length; i++) {
            a[i] = Math.ceil(Math.random() * 100);
        }
        console.log("随机产生的10个数：");
        console.log(a);
        a.sort(function (a, b) {
            return a - b;

        });
        console.log("排序后的10个数：");
        console.log(a);
    </script>
</head>

<body>

</body>

</html>